package com.funtl.screw.common.data.permission;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Lusifer
 * @since 2018/8/30 数据权限查询参数
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class DataPermissions extends ConcurrentHashMap<String, Object> {

    /**
     * 限制范围的字段名称
     */
    private String scopeName = "dept_id";

    /**
     * 具体的数据范围
     */
    private List<Long> deptIds = new ArrayList<>();

    /**
     * 是否只查询本部门
     */
    private Boolean isOnly = false;

    /**
     * 函数名称，默认 SELECT * ;
     *
     * <ul>
     * <li>COUNT(1)</li>
     * </ul>
     */
    private DataPermissionsFunctionEnum func = DataPermissionsFunctionEnum.ALL;

    public static DataPermissions of() {
        return new DataPermissions();
    }
}
